<?php
namespace app\validate;

use think\Validate;

class Product extends Validate
{
    protected $_rule = [
        'name'        => 'require',
        'mainImage'   => 'require',
        "swiper"      => 'require',
        "description" => 'require',
        "detail"      => 'require',
        "cost"        => "number",
        "price"       => "number",
        "sales"       => "number",
        "stock"       => "number",
    ];

    protected $_message = [
        'name.require'        => '商品名称必填',
        'mainImage.require'   => '商品主图必填',
        'swiper.require'      => '商品轮播图必填',
        'description.require' => '商品描述必填',
        'detail.require'      => '商品详情必填',
        "cost"                => "成本错误",
        "price"               => "售价错误",
        "sales"               => "销量错误",
        "stock"               => "库存错误",
    ];
}
